package org.jeecg.modules.demo.home.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.shiro.IgnoreAuth;
import org.jeecg.modules.demo.qingjia.entity.Qingjia;
import org.jeecg.modules.demo.qingjia.service.IQingjiaService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;

import org.jeecg.modules.erp.api.ErpHelloApi;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;

/**
 * @Description: 首页
 * @Author: jeecg-boot
 * @Date:   2024-07-18
 * @Version: V1.0
 */
@Api(tags="首页")
@RestController
@RequestMapping("/hello")
@Slf4j
public class HomeController extends JeecgController<Qingjia, IQingjiaService> {

    @Autowired
    ErpHelloApi erpHelloApi;

    /**
     * 首页
     * @param qingjia
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    @IgnoreAuth
    @ApiOperation(value="首页-say", notes="首页-say")
    @GetMapping(value = "/say")
    public Result<IPage<Qingjia>> queryPageList(Qingjia qingjia,
                                                @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                                HttpServletRequest req) {
        return Result.OK("hello");
    }



    /**
     * 微服务
     * @param req
     * @return
     */
    @ApiOperation(value="首页-sayweifuwu", notes="首页-sayweifuwu")
    @GetMapping(value = "/sayweifuwu")
    public Result<String> sayweifuwu(HttpServletRequest req) {
        String msg = erpHelloApi.callHello();
        log.info("msg:{}", msg);
        return Result.OK(msg);
    }
}
